Skip to content

Fix potential Data race in OpenMP#7345

Merged
mohanchen merged 16 commits into
deepmodeling:developfrom
mohanchen:data_race
May 17, 2026
Merged

Fix potential Data race in OpenMP#7345
mohanchen merged 16 commits into
deepmodeling:developfrom
mohanchen:data_race

Conversation

@mohanchen
Copy link
Copy Markdown
Collaborator

Fix potential Data race in OpenMP

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT GPU & DCU & HPC GPU and DCU and HPC related any issues Refactor Refactor ABACUS codes labels May 15, 2026
@mohanchen mohanchen requested a review from ZhouXY-PKU May 15, 2026 08:47
Copy link
Copy Markdown
Collaborator

@ZhouXY-PKU ZhouXY-PKU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enhancement!

abacus_fixer added 8 commits May 17, 2026 15:45
…ed member variables (nspin, nrxx, npw, gg, tpiba, tpiba2, gcar) to local const variables before OpenMP parallel regions to eliminate ThreadSanitizer false positive warnings.
…arrier directive must be inside an explicit #pragma omp parallel region, not after #pragma omp for which ends the implicit parallel region. This fixes undefined behavior when compiled with OpenMP enabled.
…o distinguish from member variables (nst -> nst_, nz -> nz_, etc.)
…distinguish from member variables (nrxx -> nrxx_, npw -> npw_, nxyz -> nxyz_, nst -> nst_, nz -> nz_, nx -> nx_, ny -> ny_, nplane -> nplane_, ig2isz -> ig2isz_)
…nguish from member variables (npy -> npy_, nx -> nx_, lixy -> lixy_, rixy -> rixy_, nplane -> nplane_, and FFTW plan objects)
…. The #pragma omp for directive already performs implicit synchronization at the end of the loop, making explicit barrier redundant.
@mohanchen mohanchen merged commit 72dd71c into deepmodeling:develop May 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT GPU & DCU & HPC GPU and DCU and HPC related any issues Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants